package com.oocl.dao.base;

import java.util.List;

public interface BaseDao {

	/**
	 * persist entity
	 * 
	 * @param entity
	 * @return
	 */
	Object persist(Object entity);

	/**
	 * update entity by ID
	 * 
	 * @param entity
	 * @return
	 */
	Object update(Object entity);

	/**
	 * delete
	 * 
	 * @param entityClass
	 * @param entity
	 */
	<T> void delete(Class<T> entityClass, Object entityId);

	/**
	 * find by entity ID
	 * 
	 * @param entityClass
	 * @param entity
	 * @return
	 */
	<T> Object find(Class<T> entityClass, Object entityId);

	/**
	 * query list of class T
	 * 
	 * @param entityClass
	 * @return
	 */
	<T> List<T> findLists(Class<T> entityClass);

}
